X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/a66f9e26487c560245ef9cd17d7e87c0cbb650af..177fd6fefd2e3d5a0ea6591c71d660cabdb3c1a4:/wp-admin/edit.php?author=%3C%3Fphp%20the_author_ID%28%29;%20%3F%3E= diff --git a/wp-admin/edit.php b/wp-admin/edit.php index ba4cc04a..b7cdcf45 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -1,76 +1,61 @@ post_type == 'attachment' ) { + if ( ! wp_delete_attachment($post_id_del) ) + wp_die( __('Error in deleting...') ); + } else { + if ( !wp_delete_post($post_id_del) ) + wp_die( __('Error in deleting...') ); + } + } -$_GET['m'] = (int) $_GET['m']; -$_GET['cat'] = (int) $_GET['cat']; -$post_stati = array( // array( adj, noun ) - 'publish' => array(__('Published'), __('Published posts')), - 'future' => array(__('Scheduled'), __('Scheduled posts')), - 'pending' => array(__('Pending Review'), __('Pending posts')), - 'draft' => array(__('Draft'), _c('Drafts|manage posts header')), - 'private' => array(__('Private'), __('Private posts')) - ); - -$avail_post_stati = $wpdb->get_col("SELECT DISTINCT post_status FROM $wpdb->posts WHERE post_type = 'post'"); - -$post_status_q = ''; -$post_status_label = __('Posts'); -if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) { - $post_status_label = $post_stati[$_GET['post_status']][1]; - $post_status_q = '&post_status=' . $_GET['post_status']; + $sendback = wp_get_referer(); + if (strpos($sendback, 'post.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/post-new.php'; + elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; + $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); + + wp_redirect($sendback); + exit(); +} elseif ( !empty($_GET['_wp_http_referer']) ) { + wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); + exit; } -?> -
+$title = __('Posts'); +$parent_file = 'edit.php'; +wp_enqueue_script('admin-forms'); - 'display name' -$posts_columns = array(); -$posts_columns['id'] = '
' . __('ID') . '
'; -if ( 'draft' === $_GET['post_status'] ) - $posts_columns['modified'] = __('Modified'); -elseif ( 'pending' === $_GET['post_status'] ) - $posts_columns['modified'] = __('Submitted'); -else - $posts_columns['date'] = __('When'); -$posts_columns['title'] = __('Title'); -$posts_columns['categories'] = __('Categories'); -if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) - $posts_columns['comments'] = '
' . __('Comments') . '
'; -$posts_columns['author'] = __('Author'); - -$posts_columns = apply_filters('manage_posts_columns', $posts_columns); - -// you can not edit these at the moment -$posts_columns['control_view'] = ''; -$posts_columns['control_edit'] = ''; -$posts_columns['control_delete'] = ''; +if ( !isset( $_GET['paged'] ) ) + $_GET['paged'] = 1; ?> +
+ +

post_title)); } else { + $post_status_label = _c('Manage Posts|manage posts header'); + if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) + $post_status_label = $post_stati[$_GET['post_status']][1]; if ( $post_listing_pageable && !is_archive() && !is_search() ) $h2_noun = is_paged() ? sprintf(__( 'Previous %s' ), $post_status_label) : sprintf(__('Latest %s'), $post_status_label); else @@ -88,36 +73,72 @@ if ( is_single() ) { } $h2_search = isset($_GET['s']) && $_GET['s'] ? ' ' . sprintf(__('matching “%s”'), wp_specialchars( get_search_query() ) ) : ''; $h2_cat = isset($_GET['cat']) && $_GET['cat'] ? ' ' . sprintf( __('in “%s”'), single_cat_title('', false) ) : ''; + $h2_tag = isset($_GET['tag']) && $_GET['tag'] ? ' ' . sprintf( __('tagged with “%s”'), single_tag_title('', false) ) : ''; $h2_month = isset($_GET['m']) && $_GET['m'] ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : ''; - printf( _c( '%1$s%2$s%3$s%4$s%5$s|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_month ); + printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month ); } ?>

- -
- -
- -
- -
- +
    1 ) : +$status_links = array(); +$num_posts = wp_count_posts( 'post', 'readable' ); +$class = empty( $_GET['post_status'] ) ? ' class="current"' : ''; +$status_links[] = "
  • " . __('All Posts') . ''; +foreach ( $post_stati as $status => $label ) { + $class = ''; + + if ( !in_array( $status, $avail_post_stati ) ) + continue; + + if ( empty( $num_posts->$status ) ) + continue; + if ( $status == $_GET['post_status'] ) + $class = ' class="current"'; + + $status_links[] = "
  • " . + sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . ''; +} +echo implode( ' |
  • ', $status_links ) . ''; +unset( $status_links ); ?> -
    - $editable_ids, 'show_option_all' => __('Any'), 'name' => 'author', 'selected' => isset($_GET['author']) ? $_GET['author'] : 0) ); ?> -
    +
+ + +

|

+ + +

+ + +

+ +
+ + add_query_arg( 'paged', '%#%' ), + 'format' => '', + 'total' => $wp_query->max_num_pages, + 'current' => $_GET['paged'] +)); + +if ( $page_links ) + echo "
$page_links
"; +?> + +
+ + +posts WHERE post_type = 'post' ORDER BY post_date DESC"; $arc_result = $wpdb->get_results( $arc_query ); @@ -125,99 +146,98 @@ $arc_result = $wpdb->get_results( $arc_query ); $month_count = count($arc_result); if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ?> + - value='0'> - yyear == 0 ) - continue; - $arc_row->mmonth = zeroise($arc_row->mmonth, 2); - - if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] ) - $default = ' selected="selected"'; - else - $default = ''; - - echo ""; - echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear"; - echo "\n"; - } - ?> - - + if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] ) + $default = ' selected="selected"'; + else + $default = ''; + echo ""; + echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear"; + echo "\n"; +} +?> + -
- -
- - + __('View all categories'), 'hide_empty' => 0, 'hierarchical' => 1, + 'show_count' => 0, 'orderby' => 'name', 'selected' => $cat); +wp_dropdown_categories($dropdown_options); +do_action('restrict_manage_posts'); +?> + + + +
- +
+
-
+
+ +
- +
+ get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); - if ($comments) { + if ( $comments ) : + // Make sure comments, post, and post_author are cached update_comment_cache($comments); + $post = get_post($id); + $authordata = get_userdata($post->post_author); ?> -

-
    -comment_post_ID); - $authordata = get_userdata($post->post_author); - $comment_status = wp_get_comment_status($comment->comment_ID); - if ('unapproved' == $comment_status) - $class .= ' unapproved'; - if ($i % 2) - $class .= ' alternate'; - echo "
  1. "; +
    + + + + + + + + + + +comment_ID, 'detail', false, false ); ?> -

    comment_author_email) { ?>| comment_author_url && 'http://' != $comment->comment_author_url) { ?> | |

    + +
    - - -

    — [ comment_post_ID) ) { - echo " " . __('Edit') . ''; - echo ' | comment_author)) . "', theCommentList );\">" . __('Delete') . ' '; - if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { - echo ' | ' . __('Unapprove') . ' '; - echo ' | ' . __('Approve') . ' '; - } - echo " | comment_post_ID . "&c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . " "; -} -?> ] -

    -
  2. -'; - }//end if comments - ?> - +endif; // comments +endif; // posts; + +?> +